package codeforces;

import java.util.Scanner;

public class TheatreSquare {

	public static void main(String[] args) {
		long n = 0;
		long m = 0;
		long a = 0;
		
		long maxN = 0;
		long maxM = 0;
		
		Scanner scanIn = new Scanner(System.in);
		n = scanIn.nextLong();
		m = scanIn.nextLong();
		a = scanIn.nextLong();
		
		long currNRest = n % a;
		long currNDiv = n / a;
		long currMRest = m % a;
		long currMDiv = m / a;
		
		if(currNRest != 0) {
			maxN = currNDiv + 1;
		} else {
			maxN = currNDiv;
		}
		if(currMRest != 0) {
			maxM = currMDiv + 1;
		} else {
			maxM = currMDiv;
		}
		
		long count = maxN * maxM;
		System.out.print(count);
	}
}
